package hibernatemock.persistence;

import java.util.LinkedHashSet;
import java.util.Set;

public class DependencyManager implements PropertyCallBack {

	private RecursiveSearch recursiveSearch = new RecursiveSearch(this);
	private Set<Object> all = new LinkedHashSet<Object>();

	public Set<Object> all(Object rootEntity) {
		all.clear();
		recursiveSearch.start(rootEntity);
		return all;
	}

	@Override public void propertyCallBack(PropertyDescription propertyDescription) {
		all.add(propertyDescription.getRootObject());
	}

}
